<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html; charset=utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>平台管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/css/plat-style.css" media="all">
    <style>
        .layui-form-label{font-weight: bold;}
    </style>
</head>
<body>

<div class="layui-container">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" id="paramEditForm">
                <input type="hidden" name="id" value="${infoParam.id}">
                <input type="hidden" name="kcode" value="${infoParam.kcode}">
                <div class="layui-form-item" style="line-height: 38px;">
                    <label class="layui-form-label">&nbsp;&nbsp;备注：</label>
                    <div class="layui-input-block">
                        <span>${infoParam.remark}</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="red">*&nbsp;</span>参数：</label>
                    <div class="layui-input-block">
                        <input type="text" name="kvalue" autocomplete="off" class="layui-input" placeholder="请输入kvalue"
                               value="${infoParam.kvalue}" style="color: red;font-weight: bold;">
                    </div>
                </div>
                <%--<div class="layui-form-item">
                    <label class="layui-form-label"><span class="red">*&nbsp;</span>数据类型</label>
                    <div class="layui-input-block">
                    	<select name="type">
                    		<option value="">请选择</option>
                    		<option <c:if test="${1==infoParam.type}">selected</c:if> value="1">整数</option>
                    		<option <c:if test="${2==infoParam.type}">selected</c:if> value="2">小数</option>
                    		<option <c:if test="${3==infoParam.type}">selected</c:if> value="3">字符</option>
                    	</select>
                    </div>
                </div>--%>
                <div class="layui-form-item" style="line-height: 38px;">
                    <label class="layui-form-label">&nbsp;&nbsp;计算方式：</label>
                    <div class="layui-input-block">
                        <span>${infoParam.otherInfo}</span>
                    </div>
                </div>
            </form>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" onclick="saveParam()">保存</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery.form.js"></script>
<script type="text/javascript" src="/js/common.js"></script>
<script type="text/javascript" src="/js/plugins/image/previewImg.js"></script>
<script>
    layui.config({
        //静态资源所在路径
        base: '/layuiadmin/'
    }).extend({
        //主入口模块
        index: 'lib/index'
    }).use(['index', 'form'], function(){
        var $ = layui.$,layer = layui.layer,element = layui.element;
    });

    function saveParam(){
        $("#paramEditForm").ajaxSubmit({
            type: 'post',
            url: '/sys/doEditParam',
            data: $("#paramEditForm").serialize(),
            dataType: 'json',
            success: function (data) {
                if (data.status) {
                    layer.msg(data.desc, {icon: 1});
                    setTimeout(function () {
                        var tabIndex = 5;
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                        window.parent.location.href = "/sys/baseInfo?tabIndex="+tabIndex;
                    }, 1000)
                } else {
                    layer.msg(data.desc, {icon: 2});
                }
            },
            error: function () {
                layer.msg("请检查页面信息是否正确", {icon: 2});
            }
        });
    }
</script>
</body>
</html>